import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Register from "../views/Register";
import uMain from "../components/user/Main";
import uHome from "../components/user/Home";
import uMy from "../components/user/My";
import uAsk from "../components/user/Ask";
import uReply from "../components/user/Reply"
import uStatic from "../components/user/Static";

import aMain from "../components/admin/Main"
import aStatic from "../components/admin/Static"
import Manage from "../components/admin/Manage";
import Type from "../components/admin/Type";
import MyAll from "../components/user/MyAll";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Login'
  },
  {
    path: '/Login',
    component: Login
  },
  {
    path: '/Register',
    component: Register
  },
  {
    path: '/user/Main',
    component: uMain,
    redirect: '/user/Home',
    children: [
      { path: '/user/Home', component: uHome},
      { path: '/user/My', component: uMy},
      { path: '/user/Ask', component: uAsk},
      { path: '/user/Reply', component: uReply},
      { path: '/user/MyAll', component: MyAll},
      { path: '/user/Static', component: uStatic}
    ]
  },
  {
    path: '/admin/Main',
    component: aMain,
    redirect: '/admin/Static',
    children: [
      { path: '/admin/Static', component: aStatic},
      { path: '/admin/Manage', component: Manage},
      { path: '/admin/Type',component: Type}
    ]
  },
]
const router = new VueRouter({
  routes
})

export default router
